package com.myl.admin.domain.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.myl.admin.validate.ValidSequence;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * LoginBodyDTO
 * author: myl <ixiaomu@qq.com>
 * tips:
 */
@Data
@Schema(name = "登录信息DTO" )
public class LoginBodyDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @JsonIgnore
    private String loginId;

    @NotBlank(message = "用户名不能为空" , groups = {ValidSequence.First.class})
    @Pattern(regexp = "^[A-Za-z][A-Za-z0-9]{4,17}$" , message = "用户名由字母开头的5-18位数字和字母组成" , groups = {ValidSequence.Second.class})
    private String username;

    @NotBlank(message = "密码不能为空" , groups = {ValidSequence.Third.class})
    @Size(min = 6, max = 10, message = "密码长度应在6到10之间" , groups = ValidSequence.Fourth.class)
    private String password;

    /**
     * 验证码
     */
    private String code;

    /**
     * 唯一标识
     */
    private String uuid;

}
